package net.hn.hnms.biz.cockpit.domain;


import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import net.hn.hnms.sys.common.core.utils.StringUtils;

import javax.persistence.Table;
import java.util.Date;

@Data
@NoArgsConstructor
@ExcelIgnoreUnannotated
@EqualsAndHashCode(callSuper=false)
@Table(name = "mine_composite_indicator", schema = "cockpit", catalog = "huaneng-cockpit")
@ApiModel(value = "矿井综合指标")
public class MineCompositeIndicator {

    @ApiModelProperty(value = "id")
    @TableField(value = "id", fill = FieldFill.INSERT)
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    @ApiModelProperty(value = "数据加工时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date checkPeriod;

    @ApiModelProperty(value = "当月风险数")
    private String monthlyRisk;

    @ApiModelProperty(value = "当月隐患数")
    private String monthlyHiddenDangers;

    @ApiModelProperty(value = "当月三违数")
    private String monthlyThreeMisses;

    @ApiModelProperty(value = "当年总进尺")
    private String yearTotalFootage;

    @ApiModelProperty(value = "当年总产量")
    private String yearTotalOutput;

    @ApiModelProperty(value = "矿编码")
    private String mineCode;

    public String getMonthlyRisk() {
        if (StringUtils.isBlank(monthlyRisk))
            return "0";
        return monthlyRisk;
    }

    public String getMonthlyHiddenDangers() {
        if (StringUtils.isBlank(monthlyHiddenDangers))
            return "0";
        return monthlyHiddenDangers;
    }

    public String getMonthlyThreeMisses() {
        if (StringUtils.isBlank(monthlyThreeMisses))
            return "0";
        return monthlyThreeMisses;
    }

    public String getYearTotalFootage() {
        if (StringUtils.isBlank(yearTotalFootage))
            return "0";
        return yearTotalFootage;
    }

    public String getYearTotalOutput() {
        if (StringUtils.isBlank(yearTotalOutput))
            return "0";
        return yearTotalOutput;
    }
}
